<template>
	<view v-if="isShow">
		<uni-tag class="defect-type-flag" v-if="defect.defectTypeName==='BUG'" :text="$t(defect.defectTypeName)" type="error" size="mini" :inverted="true" />
		<uni-tag class="defect-type-flag" v-else-if="defect.defectTypeName==='TASK'" :text="$t(defect.defectTypeName)" type="success" size="mini" :inverted="true" />
		<uni-tag class="defect-type-flag" v-else-if="defect.defectTypeName==='DEMAND'" :text="$t(defect.defectTypeName)" type="warning" size="mini" :inverted="true" />
		<uni-tag class="defect-type-flag" v-else :text="$t(defect.defectTypeName)" size="mini" :inverted="true" />
	</view>
</template>

<script>
	export default {
		name: 'DefectTypeFlag',
		props: {
			defect: {
			  type: Object,
			  default: ()=>{}
			}
		},
		computed: {
			isShow() {
				return this.$i18n.locale?true:false;
			},
		}
	}
</script>

<style lang="scss" scoped>
	.defect-type-flag {
		flex-shrink: 0;
	}
</style>